package view
{
	import flash.events.Event;
	
	import model.DataProxy;
	import model.ViewProxy;
	
	import org.puremvc.as3.interfaces.IMediator;
	import org.puremvc.as3.patterns.mediator.Mediator;

	public class GalleryViewMediator extends Mediator implements IMediator
	{
		public static const NAME:String 					= "GalleryViewMediator";
		
		private var galleryView:GalleryView;
		
		public function GalleryViewMediator( viewComponent:Object = null )
		{
			super( NAME, viewComponent );
		}
		
		override public function onRegister():void
		{			
			galleryView = new GalleryView();
			galleryView.addEventListener( GalleryView.CHANGED, galleryViewChangedHandler );
			galleryView.init( dataProxy.vo.galleryViewData, viewProxy.vo );
			
			viewProxy.vo.galleryView = galleryView;
			
		}
		
		private function galleryViewChangedHandler( e:Event ):void
		{
			
		}
		
		public function get dataProxy():DataProxy
		{
			return facade.retrieveProxy( DataProxy.NAME ) as DataProxy;
		}
		
		public function get viewProxy():ViewProxy
		{
			return facade.retrieveProxy( ViewProxy.NAME ) as ViewProxy;
		}
	}
}